﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using StructureMap.Configuration.DSL;
using D3DSS.IDomain;
using D3DSS.Domain;
using System.Configuration;
using D3DSS.Model;
using D3DSS.IRepository;
using D3DSS.Repository;
using System.Data.Entity;
using D3DSS.Utility;

namespace D3DSS.IoC
{
    /// <summary>
    /// 仓储层IoC注册
    /// </summary>
    public class RepositoryRegistry : Registry
    {
        protected string Ctor = "connectionString";
        protected string Is = ConfigHelper.GetConnectionString("D3DSS");

        public RepositoryRegistry()
        {
            For<DbContext>().Use<ModelDbContext>().Ctor<string>(Ctor).Is(Is);
            For<IRepository<DropModel>>().Use<Repository<DropModel>>();
            For<IRepository<StatisticsOrderModel>>().Use<Repository<StatisticsOrderModel>>();
            For<IRepository<AccountModel>>().Use<Repository<AccountModel>>();
            For<IRepository<UpdateInfoModel>>().Use<Repository<UpdateInfoModel>>();
        }
    }
}
